<template>
  <el-container>
    <el-header>
      <nav class="nav">
        <router-link to="/" class="logo">文章搜索系统</router-link>
        <div class="nav-links">
          <router-link to="/">首页</router-link>
          <router-link to="/qa">问答管理</router-link>
          <router-link to="/statistics">统计</router-link>
          <router-link to="/crawler">爬虫管理</router-link>
        </div>
      </nav>
    </el-header>
    
    <el-main>
      <TransitionFade>
        <router-view></router-view>
      </TransitionFade>
    </el-main>

    <GlobalLoading text="加载中..." />
  </el-container>
</template>

<script setup lang="ts">
import TransitionFade from '@/components/TransitionFade.vue'
import GlobalLoading from '@/components/GlobalLoading.vue'
</script>

<style scoped lang="scss">
.el-header {
  background-color: #fff;
  border-bottom: 1px solid #ebeef5;
  
  .nav {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    
    .logo {
      font-size: 20px;
      font-weight: bold;
      color: #409eff;
      text-decoration: none;
      transition: color 0.3s ease;

      &:hover {
        color: #66b1ff;
      }
    }
    
    .nav-links {
      display: flex;
      gap: 20px;
      
      a {
        color: #606266;
        text-decoration: none;
        transition: color 0.3s ease;
        
        &:hover,
        &.router-link-active {
          color: #409eff;
        }
      }
    }
  }
}

.el-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
</style>
